use super::super::entities::dish_flavor::Model as DishFlavor;
use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};
use utoipa::{IntoParams, ToSchema};

#[derive(Debug, Deserialize, Serialize)]
pub struct DishDTO {
    pub id: Option<i64>, // 使用 Option 以表示可能为 null
    // required: create
    pub name: Option<String>,        // 菜品名称
    pub category_id: Option<i64>,    // 菜品分类 ID
    pub price: Option<Decimal>,      // 菜品价格
    pub image: Option<String>,       // 图片
    pub description: Option<String>, // 描述信息
    pub status: Option<i32>,         // 0 停售，1 起售
    pub flavors: Vec<DishFlavor>,    // 口味集合
}

#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DishPageQueryDTO {
    pub page: usize,
    pub page_size: usize,
    pub name: Option<String>,
    pub category_id: Option<i64>,
    pub status: Option<i32>,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DishFlavorDTO {
    pub category_id: i64,
}
